package com.dyys.extension.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dyys.extension.model.User;

public interface UserMapper extends BaseMapper<User> {
//	@Update("""<script>
//		update Author
//		  <set>
//			<if test="username != null">username=#{username},</if>
//			<if test="password != null">password=#{password},</if>
//			<if test="email != null">email=#{email},</if>
//			<if test="bio != null">bio=#{bio}</if>
//		  </set>
//		where id=#{id}
//	  </script>""")
//	public Object selectById(int id);
	
	@Select("<script>SELECT 1 ii, u.* FROM m_user u WHERE u.id=#{id}</script>")
	User loadById(Long id);
	
	@Select("SELECT 1 ii, u.* FROM m_user u WHERE u.login_Name=#{loginName}")
	List<User> loadBy(Map<String,Object> params);
	
	@Select("SELECT * FROM m_user")
	Page<User> selectUserPage(Page page);
	
	List<User> loadBy_usingNamedSql_xml(Map<String,Object> params);

}